/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mii.dao.impl;

import javax.persistence.EntityManager;
import mii.dao.GenericDAO;

    
/**
 *
 * @author Sven
 */
public class GenericDAOImpl implements GenericDAO{
 protected EntityManager em;

    public GenericDAOImpl(EntityManager em) {
        this.em = em;
    }

    @Override
    public void insert(Object obj) {
      //  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        this.em.persist(obj);
        }

    @Override
    public void update(Object obj) {
//        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        this.em.merge(obj);
                
    }
    
    @Override
    public void delete(Object obj) {
       //hrow new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        this.em.remove(obj);
    }
    }
